package com.whynot.frame.jdk.statictest;

public class UserUtil {
	
	private static User user;
	
	private String str;
	
	private int age;
	
	{
		str = "test";
		System.out.println("通过初始块设置str");
	}

	static{
		user = new User();
		user.setName("Cy");
		user.setPwd("123");
		System.out.println(user);
		System.out.println("通过静态初始块设置用户");
	}
	
	public UserUtil() {
		this.age = 24;
		System.out.println("通过构造函数设置age");
	}



	public static void say(){
		System.out.println("hello"+user.getName());
	}

}
